package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysGoodsFileMapper;
import com.ruoyi.project.system.domain.SysGoodsFile;
import com.ruoyi.project.system.service.ISysGoodsFileService;

/**
 * 商品文件Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-21
 */
@Service
public class SysGoodsFileServiceImpl implements ISysGoodsFileService 
{
    @Autowired
    private SysGoodsFileMapper sysGoodsFileMapper;

    /**
     * 查询商品文件
     * 
     * @param fileId 商品文件ID
     * @return 商品文件
     */
    @Override
    public SysGoodsFile selectSysGoodsFileById(Long fileId)
    {
        return sysGoodsFileMapper.selectSysGoodsFileById(fileId);
    }

    /**
     * 查询商品文件列表
     * 
     * @param sysGoodsFile 商品文件
     * @return 商品文件
     */
    @Override
    public List<SysGoodsFile> selectSysGoodsFileList(SysGoodsFile sysGoodsFile)
    {
        return sysGoodsFileMapper.selectSysGoodsFileList(sysGoodsFile);
    }

    @Override
    public List<SysGoodsFile> queryGoodsFile(Long goodsId) {
        return sysGoodsFileMapper.queryGoodsFile(goodsId);
    }

    /**
     * 新增商品文件
     * 
     * @param sysGoodsFile 商品文件
     * @return 结果
     */
    @Override
    public int insertSysGoodsFile(SysGoodsFile sysGoodsFile)
    {
        sysGoodsFile.setCreateTime(DateUtils.getNowDate());
        return sysGoodsFileMapper.insertSysGoodsFile(sysGoodsFile);
    }

    /**
     * 修改商品文件
     * 
     * @param sysGoodsFile 商品文件
     * @return 结果
     */
    @Override
    public int updateSysGoodsFile(SysGoodsFile sysGoodsFile)
    {
        return sysGoodsFileMapper.updateSysGoodsFile(sysGoodsFile);
    }

    /**
     * 批量删除商品文件
     * 
     * @param fileIds 需要删除的商品文件ID
     * @return 结果
     */
    @Override
    public int deleteSysGoodsFileByIds(Long[] fileIds)
    {
        return sysGoodsFileMapper.deleteSysGoodsFileByIds(fileIds);
    }

    /**
     * 删除商品文件信息
     * 
     * @param goodsId 商品文件ID
     * @return 结果
     */
    @Override
    public int deleteSysGoodsFileByGoodsId(Long goodsId)
    {
        return sysGoodsFileMapper.deleteSysGoodsFileByGoodsId(goodsId);
    }
}
